<?php
    // anonymous PHP function stored in the variable $f
    $f = function($a, $b) {
        return $a + $b;
    };

    // pass the function to another function
    $result = other_function($f);
    echo 'run here' . $result;

    // or pass an anonymous function without assigning it to a variable
    other_function(function($a, $b) {
        return $a * $b;
    });